import request from "@/utils/request";
import {LoginData} from "@/api/user";

export interface LoginData {
    username: string
    password: string
}

export function login(data: LoginData) {
    return request({
        url: '/auth/doLogin',  // 确保这是正确的登录接口路径
        method: 'post',
        data
    })
}

export function getUserInfo() {
    return request({
        url: '/user/info',
        method: 'get'
    })
}

export function logout() {
    return request({
        url: '/auth/doLogout',
        method: 'post'
    })
}